Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
This package helps with distributing binaries via npm.
First, create your compiled binaries and make them available via HTTPS.
Now create your npm installer: Make a package.json
that looks like this:
{
"name": "myApp",
"version": "1.0.0",
"description": "Install myApp",
"preferGlobal": true,
"main": "index.js",
"scripts": {
"install": "binwrap-install",
"prepare": "binwrap-prepare",
"test": "binwrap-test",
"prepublish": "npm test"
},
"license": "BSD-3-Clause",
"files": [
"index.js",
"bin"
],
"bin": {
"myapp-cli": "bin/myapp-cli"
},
"dependencies": {
"binwrap": "^0.2.3"
}
}
Then create your index.js
file like this:
var binwrap = require("binwrap");
var path = require("path");
var packageInfo = require(path.join(__dirname, "package.json"));
var version = packageInfo.version;
var root = "https://dl.bintray.com/me/myApp/" + version;
module.exports = binwrap({
dirname: __dirname,
binaries: [
"myapp-cli"
],
urls: {
"darwin-x64": root + "/mac-x64.tgz",
"linux-x64": root + "/linux-x64.tgz",
"win32-x64": root + "/win-i386.zip",
"win32-ia32": root + "/win-i386.zip"
}
});
Then run npm test
to verify that your packages are published correctly.
Finally, run npm publish
when you are ready to publish your installer.
Javascript code can get the absolute path to a binary from a package that uses binwrap
as follows (in this example, "my-package" is a published npm package that uses binwrap,
and has a my-package-cli
binary):
const cliPath = require('my-package').paths['my-package-cli'];
FAQs
Package cross-platform binaries
The npm package binwrap receives a total of 7,887 weekly downloads. As such, binwrap popularity was classified as popular.
We found that binwrap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.